export const getStorage = key => {
  return new Promise((resolve, reject) => {
    uni.getStorage({
      key,
      success: function (res) {
        resolve(res.data)
      },
      fail: function (err) {
        reject(err)
      },
    })
  })
}

export const setStorage = (key, data) => {
  return new Promise((resolve, reject) => {
    uni.setStorage({
      key,
      data,
      success: function (res) {
        resolve(res.data)
      },
      fail: function (err) {
        reject(err)
      },
    })
  })
}
